#include "rcc_configure.h"
#include "stm32f0xx_rcc.h"
void RCC_Configuration(void)
{
  RCC_DeInit(); 
//RCC_HSICmd(ENABLE);	//???????
  RCC_PLLConfig(RCC_PLLSource_HSI_Div2, RCC_PLLMul_12);   //??PLL??????PLL????,?????????????,6?? ??24MHz
  RCC_PLLCmd(ENABLE);                                    //??????PLL
  while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY)==RESET);      //??PLL???????
  
  RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);             //???????,??????????????????:HSI,HSE,RCC_SYSCLKSource_PLLCLK?
	while(RCC_GetSYSCLKSource() != 0x08);                  //???????????, 0x00: HSI used as system clock,0x04: HSE used as system clock ,0x08: PLL used as system clock ?        
  
	RCC_HCLKConfig(RCC_SYSCLK_Div1);                       //???AHB????,??PLL?AHB???????????AHB?????PLL?????
  RCC_PCLKConfig(RCC_HCLK_Div1);                         //??APB????
  RCC_ADCCLKConfig(RCC_ADCCLK_PCLK_Div4);                //ADC????,?????14MHz
	 
  SystemCoreClockUpdate();                                          //??PLL??SYSCLK???                  
}
